package com.ymatou.iapi.godmch.testcase;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.sun.org.apache.bcel.internal.generic.NEW;
import com.ymatou.iapi.dguser.parameter.UserCreateBean;
import com.ymatou.iapi.dguser.parameter.UserDto;
import com.ymatou.iapi.godmch.parameter.GetListByConditionBean;
import com.ymatou.iapi.godmch.parameter.applyAgentBean;
import com.ymatou.iapi.godmch.parameter.applySupplierBean;
import com.ymatou.iapi.godmch.parameter.approveAgentBean;
import com.ymatou.iapi.godmch.parameter.createIndepMchBean;
import com.ymatou.iapi.godmch.parameter.createagentBean;
import com.ymatou.iapi.godmch.parameter.createmchBean;
import com.ymatou.iapi.godmch.parameter.editmchBean;
import com.ymatou.iapi.godmch.parameter.mchInfo;
import com.ymatou.iapi.godmch.parameter.setShareTypeBean;
import com.ymatou.iapi.godmch.service.GetListByConditionCall;
import com.ymatou.iapi.godmch.service.applyAgentCall;
import com.ymatou.iapi.godmch.service.applySupplierCall;
import com.ymatou.iapi.godmch.service.createIndepMchCall;
import com.ymatou.iapi.godmch.service.createagentCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.DGUserCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.database.model.agent_type;
import com.ymttest.database.model.mch_info;
import com.ymttest.database.model.godmch.mch_config;
import com.ymttest.database.model.godmch.mch_configExample;
import com.ymttest.database.sqlwapper.godmch.country_infoWapper;
import com.ymttest.database.sqlwapper.godmch.mch_configWapper;
import com.ymttest.database.sqlwapper.godmch.mch_infoWapper;
import com.ymttest.utils.EnvSetup;
/**
*查询商户信息（运营后台）id
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetListByCondition{
	private static GetListByConditionBean bean;
	private static GetListByConditionCall call;
	private static mch_infoWapper mchinfoWapper=new mch_infoWapper();
	private static mch_configWapper mchconfigWapper;
	
	Integer masterChainShopId_wechatDirectPayMode=Integer.parseInt(EnvSetup.getData("masterChainShopId_wechatDirectPayMode"));
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("查询商户信息（运营后台）id");
	}

	@Before
	public void caseUp() {
		bean=new GetListByConditionBean();
		call=new GetListByConditionCall();
		mchconfigWapper=new mch_configWapper();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	private void check_verify(UserCreateBean... usercreateBean1) throws Exception
	{
		HashMap<String,Object> map=new HashMap();
		Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");
		//如果手机号不为空，则根据手机号查询商户id
        Integer mchId=0;
        if(bean.getPhone()!=null && bean.getAreaCode()!=null )
        {
            mchId=new DGUserCallService().getSellerIdByMoblie(bean.getPhone(), bean.getAreaCode());
        	if(mchId==0)
        		mchId=-1;
        	map.put("mchId", mchId);
        }
		if(bean.getMchId()!=null && mchId!=-1)
		  map.put("mchId", bean.getMchId());
		if(bean.getMchTitle()!=null)
	      map.put("mchTitle", bean.getMchTitle());
		////商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
		if(bean.getMchType()!=null)
			 map.put("mchType", bean.getMchType());
		
		if(bean.getPageIndex()==0)
			 map.put("pageIndex", 1);
		else
			map.put("pageIndex", bean.getPageIndex());
		if(bean.getPageSize()==0)
			map.put("pageSize", 5);
		else
			map.put("pageSize", bean.getPageSize());
		

		List<mch_info> act_info=mchinfoWapper.selectby(map);
		int count=mchinfoWapper.selectCount(map);//总数
		int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
		Logger.verifyEquals(count,  exp_total, "验证返回的total");
		
		if(act_info.size()>0)
		{
		  JsonArray exp_infoList=call.getJsonObject().get("result").getAsJsonObject().get("mchInfoList").getAsJsonArray();
		  for(int i=0;i<act_info.size();i++){
			mch_info act=act_info.get(i);
			Logger.comment("###########验证商户Id：################ "+act.getMchId());
			JsonObject exp=exp_infoList.get(i).getAsJsonObject();
			Logger.verifyEquals(act.getAgent()==0?false:true,exp.get("agent").getAsBoolean(), "验证返回的agent与数据库中的agent 是否一致");
			Logger.verifyEquals(act.getChannels()==0?false:true, exp.get("channel").getAsBoolean(), "验证返回的Channels与数据库中的Channels 是否一致");
			Logger.verifyEquals(act.getVip()==0?false:true, exp.get("vip").getAsBoolean(), "验证返回的Vip与数据库中的Vip 是否一致");
			Logger.verifyEquals(act.getSeqId(), exp.get("seqId").getAsInt(), "验证返回的SeqId与数据库中的SeqId 是否一致");
			Logger.verifyEquals(act.getMchId(),exp.get("mchId").getAsInt(), "验证返回的MchId与数据库中的MchId 是否一致");
			Logger.verifyEquals(act.getMchTitle(), exp.get("mchTitle").getAsString(), "验证返回的MchTitle与数据库中的MchTitle 是否一致");
			Logger.verifyEquals(act.getAvatar(), exp.get("avatar").getAsString(), "验证返回的Avatar与数据库中的Avatar 是否一致");
			Logger.verifyEquals(act.getCurrency(), exp.get("currency").getAsString(), "验证返回的Currency与数据库中的Currency 是否一致");
			Logger.verifyEquals(act.getCountry(),  exp.get("country").getAsString(), "验证返回的Country与数据库中的country 是否一致");
			//根据商户查找手机号
			UserDto userInfo=new DGUserCallService().getDGUserInfo(act.getMchId());
			if(exp.get("phone")==null)
				Logger.verifyIsNull(exp.get("phone"), "验证返回的phone为空");
			else 
			   Logger.verifyEquals(userInfo.getMobileAreaCode()+"_"+userInfo.getMobile(), exp.get("phone").getAsString(), "验证返回的phone");
			
			Logger.verifyEquals(act.getMchShareType(),  exp.get("mchShareType").getAsInt(), "验证返回的mchShareType");
			Logger.verifyEquals(act.getState(),  exp.get("mchStatus").getAsInt(), "验证返回的mchStatus");
			Logger.verifyEquals(act.getRemark(),  exp.get("remark").getAsString(), "验证返回的remark");
			java.text.DateFormat format1 = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			Logger.verifyEquals(format1.format(act.getCreateTime()).substring(0, 10)+"T"+format1.format(act.getCreateTime()).substring(11,19),  exp.get("createTime").getAsString(), "验证返回的createTime");
			//Logger.verifyEquals(2,  exp.get("payMode").getAsInt(), "验证返回的payMode");
			Logger.verifyEquals(act.getPayMode(),  exp.get("payMode").getAsInt(), "验证返回的payMode");
			Logger.verifyEquals(act.getMchType(), exp.get("mchType").getAsInt(), "验证 mchType");
			
			//双店模式
			Logger.verifyEquals(act.getDualMode(),  exp.get("dualMode").getAsInt(), "验证返回的dualMode");
			
		       //20201020 新增
			Logger.verifyEquals(act.getYabandPayMode(),exp.get("yabandPayMode").getAsInt(), "验证YabandPayMode");
			
			//是否独立商户主账号 20200326
			if(act.getMchType()==2)
			{
				if(act.getIndepMchFlg()==1)
				  Logger.verifyEquals("独立云版本-主商家", exp.get("mchTypeName").getAsString(), "验证 mchTypeName");
				else if(act.getIndepMchFlg()==2 && !act.getCountry().equals("CHN"))
			      Logger.verifyEquals("独立云版本-海外供货商", exp.get("mchTypeName").getAsString(), "验证 mchTypeName");
				else if(act.getIndepMchFlg()==2 && act.getCountry().equals("CHN"))
				  Logger.verifyEquals("独立云版本-国内供货商", exp.get("mchTypeName").getAsString(), "验证 mchTypeName");
				else if(act.getIndepMchFlg()==3 && !act.getCountry().equals("CHN"))
				  Logger.verifyEquals("独立云版本-海外代理商", exp.get("mchTypeName").getAsString(), "验证 mchTypeName");
				else if(act.getIndepMchFlg()==3 && act.getCountry().equals("CHN"))
				  Logger.verifyEquals("独立云版本-国内代理商", exp.get("mchTypeName").getAsString(), "验证 mchTypeName");
				
			}
			else if(act.getMchType()==1){
				if(act.getChannels()==1  && act.getCountry()!="CHN")
				  Logger.verifyEquals("公共云版本-海外渠道商", exp.get("mchTypeName").getAsString(), "验证 mchTypeName");
				else if(act.getChannels()==1  && act.getCountry()=="CHN")
					Logger.verifyEquals("公共云版本-国内渠道商", exp.get("mchTypeName").getAsString(), "验证 mchTypeName");
				else if(act.getAgent()==1 && act.getCountry()=="CHN")
					Logger.verifyEquals("公共云版本-代理渠道商", exp.get("mchTypeName").getAsString(), "验证 mchTypeName");
			} 
			 
			
			//购买方式
			 mch_configExample example=new mch_configExample();
		     example.createCriteria().andMchIdEqualTo(act.getMchId());
		     List<mch_config> mchconfigs=mchconfigWapper.selectByExample(example);
		   if(mchconfigs.size()>0)
		   { 
			  mch_config mchconfig=mchconfigWapper.selectByExample(example).get(0);
			  Logger.verifyEquals(mchconfig.getMchSideBuy(),  exp.get("mchSideBuy").getAsInt(), "验证返回的mchSideBuy");
			  //风控
			  Logger.verifyEquals(mchconfig.getProductRiskAmount().stripTrailingZeros().toPlainString(),new BigDecimal(exp.get("productRiskAmount").toString()).stripTrailingZeros().toPlainString(), "验证数据库mch_confog 中字段ProductRiskAmount与传入的ProductRiskAmount是否一致");
	          Logger.verifyEquals(mchconfig.getTradeRiskAmount().stripTrailingZeros().toPlainString(),new BigDecimal(exp.get("tradeRiskAmount").toString()).stripTrailingZeros().toPlainString(), "验证数据库mch_confog 中字段TradeRiskAmount与传入的TradeRiskAmount是否一致");
	          
		   }else {
			   //没有查到说明是代理角色，代理默认是2
			   Logger.verifyEquals(2,  exp.get("mchSideBuy").getAsInt(), "验证返回的mchSideBuy");
		    }
		  }
		}
	}
	
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_002_1() {
		Logger.start(true,"正例-查询商户信息（运营后台）-1：独立商家");
		try { 
			//渠道
			createIndepMchBean createBean=GodmchManageCallService.InitCreateIndepMchBean();
			//createBean.setAgentInvite(false);
			createIndepMchCall createCall=GodmchManageCallService.CreateIndepMchCall(createBean);
			
			bean.setMchId(createCall.getmchId());
		    bean.setMchTitle(createBean.getTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setAreaCode("1");
			//bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(1);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_002_2() {
		Logger.start(true,"正例-查询商户信息（运营后台）-2：独立云版本-海外供货商");
		try { 

			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //同意
            GodmchManageCallService.approveSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
			
			bean.setMchId(applySupplierCall.getSupplierId());
			//bean.setMchTitle(createBean.getTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setAreaCode("1");
			//bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(2);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_GetListByCondition_002_3() {
		//Logger.start(true,"正例-查询商户信息（运营后台）-3 独立云版本-国内供货商(现在独立商户时 mchType=3需要手工切，没有解决，此结果暂时失败)");
		Logger.start(true,"正例-查询商户信息（运营后台）-3 独立云版本-国内供货商(后面需求要添加)");
		try { 
		
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
            //申请供货商
            applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createIndepMchCall.getmchId());
            applySupplierBean.setCountry("CHN");
            applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
            //同意
            GodmchManageCallService.approveSupplier(createIndepMchCall.getmchId(), applySupplierCall.getSupplierId());
            
			bean.setMchId(applySupplierCall.getSupplierId());
			//bean.setMchTitle(createBean.getTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setAreaCode("1");
			//bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(3);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			// check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_001() {
		Logger.start(true,"正例-查询商户信息（运营后台）-4 独立云版本-海外代理商");
		try {
			//创建独立商户1
			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
            createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
			//审核
            applyAgentCall applyAgentCall=GodmchManageCallService.applyAndapproveAgent(createIndepMchCall.getmchId());
			
			bean.setMchId(applyAgentCall.getAgentId());
			//bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setAreaCode("1");
			//bean.setPhone(usercreateBean1.getMobile());
			/**
			 * 商户类型
				1 - 独立云版本-主商家
				2 - 独立云版本-海外供货商
				3 - 独立云版本-国内供货商
				4 - 独立云版本-海外代理商
				5 - 独立云版本-国内代理商
				6 - 公共云版本-海外渠道商
				7 - 公共云版本-国内渠道商
				8 - 公共云版本-国内代理商
			 */
			bean.setMchType(4);
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_001_2() {
		Logger.start(true,"正例-查询商户信息（运营后台）-5独立云版本-国内代理商");
		try {
			approveAgentBean approveAgentBean=new approveAgentBean();
	    	
			//申请代理
			applyAgentBean applyBean=GodmchManageCallService.InitApplyAgentBean();
			applyBean.setCountry("CHN");
			applyAgentCall applyCall=GodmchManageCallService.ApplyAgentCall(applyBean);
			//代理类型
			createagentBean agentBean=GodmchManageCallService.InitCreateAgentTypeBean(applyBean.getMchId());
			createagentCall agentCall=GodmchManageCallService.CreateAgentTypeCall(agentBean);
			//查询代理类型
			Map<String,Object> map=new HashMap();
			map.put("mchId", applyBean.getMchId());
			List<agent_type> list=GodmchManageCallService.agentTypeWapper.selectby(map);
			
			approveAgentBean.setMchId(applyBean.getMchId());
			approveAgentBean.setAgentId(applyCall.getAgentId());
			approveAgentBean.setAgentType(list.get(0).getAgentType());
			approveAgentBean.setAgentMode(1);
			
			bean.setMchId(approveAgentBean.getAgentId());
//			bean.setMchTitle(editmchbean2.getMchTitle());
//			bean.setAreaCode(usercreateBean1.getMobileAreaCode());
//			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(5);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();	
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_001_3() {
		Logger.start(true,"正例-查询商户信息（运营后台）-6公共云版本-海外渠道商");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(userId_channl);
//			bean.setMchTitle(editmchbean2.getMchTitle());
//			bean.setAreaCode(usercreateBean1.getMobileAreaCode());
//			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(6);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();	
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_001_4() {
		Logger.start(true,"正例-查询商户信息（运营后台）-7公共云版本-国内渠道商(后面需求要此需求)");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			createmchbean.setCountry("HKG");
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(userId_channl);
//			bean.setMchTitle(editmchbean2.getMchTitle());
//			bean.setAreaCode(usercreateBean1.getMobileAreaCode());
//			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(7);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();	
			
		//	check_verify(usercreateBean1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_001_1() {
		Logger.start(true,"正例-查询商户信息（运营后台）-国内纯代理 8公共云版本-国内代理商");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();//初始化创建用户 为什么手机号没有值
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			//代理
			usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_agent=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			//创建代理
			List<createmchBean> createmchList=GodmchManageCallService.InitcreatemchBeanForAgent(userId_channl, userId_agent);
			createmchList.get(0).setCountry("CHN");
			GodmchManageCallService.createmchCallForAgent(createmchList.toArray(new
					createmchBean[createmchList.size()]));
			editmchBean editmchbean2 = GodmchManageCallService.IniteditmachBean(userId_agent);
			GodmchManageCallService.editmachCall(editmchbean2);
			
			bean.setMchId(userId_agent);
			bean.setMchTitle(editmchbean2.getMchTitle());
			bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(8);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();	
			
			check_verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_002() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入的商户与商户类型不一样");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			bean.setAreaCode("1");
			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(2);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");	
			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
			Logger.verifyEquals(0,  exp_total, "验证返回的total");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_003() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入mchType=2商户类型国内代理商，但商户是国外代理商");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			//代理
			usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_agent=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			//创建代理
			List<createmchBean> createmchList=GodmchManageCallService.InitcreatemchBeanForAgent(userId_channl, userId_agent);
			//createmchList.get(0).setCountry("CHN");
			GodmchManageCallService.createmchCallForAgent(createmchList.toArray(new
					createmchBean[createmchList.size()]));
			editmchBean editmchbean2 = GodmchManageCallService.IniteditmachBean(userId_agent);
			GodmchManageCallService.editmachCall(editmchbean2);
			
			bean.setMchId(userId_agent);
			bean.setMchTitle(editmchbean2.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			bean.setAreaCode("1");
			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(2);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();			
			
			Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");	
			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
			Logger.verifyEquals(0,  exp_total, "验证返回的total");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_003_1() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入手机区号 与 手机号查不多,返回空");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(999);
			bean.setMchTitle(editmchbean.getMchTitle());
			bean.setAreaCode("qwe");
			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(2);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();		
			
			Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");	
			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
			Logger.verifyEquals(0,  exp_total, "验证返回的total");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_004() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入商户id不存在");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(999);
			bean.setMchTitle(editmchbean.getMchTitle());
			bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(2);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();		
			
			Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");	
			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
			Logger.verifyEquals(0,  exp_total, "验证返回的total");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_005() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入商户名称不存在");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();//初始化创建用户 为什么手机号没有值
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle("12313");
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			bean.setAreaCode("1");
			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(2);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();		
			
			Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");	
			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
			Logger.verifyEquals(0,  exp_total, "验证返回的total");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_006() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入商户手机号不存在");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();//初始化创建用户 为什么手机号没有值
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			bean.setAreaCode("1");
			bean.setPhone("186454544545");
			bean.setMchType(2);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();		
			
			Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");	
			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
			Logger.verifyEquals(0,  exp_total, "验证返回的total");			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_007() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入商户类型不存在-直接放弃此条件");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();//初始化创建用户 为什么手机号没有值
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			bean.setPhone(usercreateBean1.getMobile());
			bean.setMchType(3);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商 
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();		
			
			check_verify(usercreateBean1);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_007_1() {
		Logger.start(true,"反例-查询商户信息（运营后台）-字段为空-查出所有");
		try {

			//bean.setMchId(userId_channl);
			//bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setPhone(usercreateBean1.getMobile());
			//bean.setMchType(3);//商户类型1:海外渠道商2:国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();		
			
			check_verify();		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_008() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入pageIndex=0时，默认传入1");
		try {
//			//渠道
//			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();//初始化创建用户 为什么手机号没有值
//			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
//			
//			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
//			GodmchManageCallService.createmchCallForChannel(createmchbean);
//			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
//			GodmchManageCallService.editmachCall(editmchbean);
//			
//			bean.setMchId(userId_channl);
//			bean.setMchTitle(editmchbean.getMchTitle());
//			bean.setPhone(usercreateBean1.getMobile());
//			bean.setMchType(3);//商户类型1:海外渠道商2:国内代理商
			bean.setPageIndex(0);
			bean.setPageSize(5);
			
			call.setData(bean);
			call.callService();				
			
			check_verify();	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_009() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入pageIndex=99,大于当前最大页数");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();//初始化创建用户 为什么手机号没有值
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			//createmchbean.setCountry(usercreateBean1.getCountryCode());
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setAreaCode("1");
			//bean.setPhone(usercreateBean1.getMobile());
			//bean.setMchType(1);//商户类型1:海外渠道商2:国内代理商 
			bean.setPageIndex(99);
			bean.setPageSize(50);
			
			call.setData(bean);
			call.callService();		
			
			Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");	
			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
			Logger.verifyEquals(1,  exp_total, "验证返回的total");	
			JsonArray exp_infoList=call.getJsonObject().get("result").getAsJsonObject().get("mchInfoList").getAsJsonArray();
			Logger.verifyEquals(0,  exp_infoList.size(), "验证返回的mchInfoList 为空");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_010() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入pageSize=0时，默认5");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();//初始化创建用户 为什么手机号没有值
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
//			bean.setMchId(userId_channl);
//			bean.setMchTitle(editmchbean.getMchTitle());
//			bean.setPhone(usercreateBean1.getMobile());
//			bean.setMchType(1);//商户类型1:海外渠道商2:国内代理商 
			bean.setPageIndex(1);
			bean.setPageSize(0);
			
			call.setData(bean);
			call.callService();		
			check_verify();	
			
//			Logger.verifyEquals("200", call.getStatus1(), "验证返回成功status值");
//	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");	
//			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
//			Logger.verifyEquals(1,  exp_total, "验证返回的total");	
//			JsonArray exp_infoList=call.getJsonObject().get("result").getAsJsonObject().get("mchInfoList").getAsJsonArray();
//			Logger.verifyEquals(1,  exp_infoList.size(), "验证返回的mchInfoList 为空");			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_011() {
		Logger.start(true,"反例-查询商户信息（运营后台）-传入pageSize=100000,大于总条数");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();//初始化创建用户 为什么手机号没有值
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setPhone(usercreateBean1.getMobile());
			//bean.setMchType(4);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(100000);
			
			call.setData(bean);
			call.callService();		
			
			check_verify(usercreateBean1);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_012() {
		Logger.start(true,"正例-查询商户信息（运营后台）-验证渠道是双店模式");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			 //设置双店模式
			setShareTypeBean setBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			//setBean.setMchSideBuy(2);//1:二维码购买 2:直接购买
			GodmchManageCallService.setShareTypeV2Call(setBean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setAreaCode("1");
			//bean.setPhone(usercreateBean1.getMobile());
			//bean.setMchType(4);//商户类型1独立云版本-主商家 2独立云版本-海外供货商 3 独立云版本-国内供货商 4独立云版本-海外代理商 5独立云版本-国内代理商  6公共云版本-海外渠道商7公共云版本-国内渠道商8公共云版本-国内代理商
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			check_verify(usercreateBean1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_013() {
		Logger.start(true,"正例-查询商户信息（运营后台）-验证渠道是二维码购买");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			 //设置双店模式
			setShareTypeBean setBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			setBean.setPayMode(2);
			setBean.setMchSideBuy(1);//1:二维码购买 2:直接购买
			GodmchManageCallService.setShareTypeV2Call(setBean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setAreaCode("1");
			//bean.setPhone(usercreateBean1.getMobile());
			//bean.setMchType(4);//商户类型1：独立商家  2：独立-海外用户 3：独立-国内用户 4：平台-海外用户  5：平台-国内用户
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			check_verify(usercreateBean1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_014() {
		Logger.start(true,"正例-查询商户信息（运营后台）-验证渠道是直接购买");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			 //设置双店模式
			setShareTypeBean setBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			setBean.setPayMode(2);//支付方式:微信支付通道1：飞界国际2：飞界国际电子商务3：盛付通
			setBean.setMchSideBuy(2);//1:二维码购买 2:直接购买
			GodmchManageCallService.setShareTypeV2Call(setBean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			//bean.setAreaCode(usercreateBean1.getMobileAreaCode());
			//bean.setAreaCode("1");
			//bean.setPhone(usercreateBean1.getMobile());
			//bean.setMchType(4);//商户类型1：独立商家  2：独立-海外用户 3：独立-国内用户 4：平台-海外用户  5：平台-国内用户
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			check_verify(usercreateBean1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_015() {
		Logger.start(true,"正例-查询商户信息（运营后台）-验证渠道是不是支持海外地址、开启图片补白功能-返回成功");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			 //设置不是支持海外地址、开启图片补白功能
			setShareTypeBean setBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			setBean.setOverseasAddressEnabled(false);//是否支持海外地址
			setBean.setProductPicAutoFill(true);//是否开启图片补白功能
			GodmchManageCallService.setShareTypeV2Call(setBean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			check_verify(usercreateBean1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_016() {
		Logger.start(true,"正例-查询商户信息（运营后台）-验证渠道是支持海外地址、不开启图片补白功能-返回成功");
		try {
			//渠道
			UserCreateBean usercreateBean1=DGUserCallService.initSellerUsercreateBean();
			int userId_channl=DGUserCallService.UserCreateCall(usercreateBean1);
			createmchBean createmchbean=GodmchManageCallService.InitcreatemchBeanForChannel(userId_channl);
			GodmchManageCallService.createmchCallForChannel(createmchbean);
			editmchBean editmchbean = GodmchManageCallService.IniteditmachBean(userId_channl);
			GodmchManageCallService.editmachCall(editmchbean);
			
			 //设置不是支持海外地址、开启图片补白功能
			setShareTypeBean setBean=GodmchManageCallService.initsetShareTypeV2(userId_channl);
			setBean.setOverseasAddressEnabled(true);//是否支持海外地址
			setBean.setProductPicAutoFill(false);//是否开启图片补白功能
			GodmchManageCallService.setShareTypeV2Call(setBean);
			
			bean.setMchId(userId_channl);
			bean.setMchTitle(editmchbean.getMchTitle());
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			check_verify(usercreateBean1);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetListByCondition_017() {
		Logger.start(true,"正例-查询商户信息（运营后台）-验证masterChainShopId连锁店、wechatDirectPayMode微信直连-返回成功");
		try {
			
			bean.setMchId(masterChainShopId_wechatDirectPayMode); 
			//bean.setMchTitle(editmchbean.getMchTitle());
			bean.setPageIndex(1);
			bean.setPageSize(5);
			call.setData(bean);
			call.callService();			
			
			HashMap<String,Object> map=new HashMap();
			map.put("mchId", bean.getMchId());
			List<mch_info> act_info=mchinfoWapper.selectby(map);
			int count=mchinfoWapper.selectCount(map);//总数
			int exp_total=call.getJsonObject().get("result").getAsJsonObject().get("total").getAsInt();
			Logger.verifyEquals(count,  exp_total, "验证返回的total");
			
			if(act_info.size()>0)
			{
			  JsonArray exp_infoList=call.getJsonObject().get("result").getAsJsonObject().get("mchInfoList").getAsJsonArray();
			  for(int i=0;i<act_info.size();i++){
				 mch_info act=act_info.get(i);
			     JsonObject exp=exp_infoList.get(0).getAsJsonObject();
			     Logger.verifyEquals(act.getAgent()==0?false:true,exp.get("wechatDirectPayMode").getAsBoolean(), "验证返回的wechatDirectPayMode与数据库中的wechatDirectPayMode 是否一致");
			     
			     //20201027 新增字段  masterChainShopId连锁店、wechatDirectPayMode微信直连
				 Logger.verifyEquals(act.getWechatDirectPayMode(),exp.get("wechatDirectPayMode").getAsInt(), "验证wechatDirectPayMode");
				 Logger.verifyEquals(act.getMasterChainShopId(),exp.get("masterChainShopId").getAsInt(), "验证masterChainShopId");
			  }
			}
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}